tooldir=${pkgdatadir}/tools/CHARMM_Patch
dist_tool_SCRIPTS= eef1.fcm  eef1.src  enbfast.src  patch_charmm.sh

all : all-am
	@echo "Patching CHARMM..."
	@set +e
	./patch_charmm.sh || { echo "Please run path_charmm.sh later in ${tooldir}"; }
	@set -e
	
check : check-am
	@echo "UnPacking the test case ..."
	@echo "=========================================="
	@tar -zxvf test.tar.gz | tee .testfiles
	@echo "=========================================="
	@./test.sh ./imm1pb neutral
	@./test.sh ./imm1pb anionic
	@./test.sh ./imm1pb pb
	@./test.sh ./imm1pb shape 
clean : clean-am
	@[ -f .testfiles ] && { cat .testfiles | while read f;do echo "rm -f $$f";rm -f $$f; done }
	
install : install-am 
	@[ -f ./imm1pb ] && { \
	echo "=========================================="; \
	echo "cp ./imm1pb ${bindir}";\
	cp ./imm1pb ${bindir}; \
	 } || { \
		echo "=========================================="; \
		echo "Imm1pb not generated!"; echo "Please run patch_charmm.sh."; \
	}
